import requestProxy from '@/utils/request';
const { request } = requestProxy;

// 获取表情包列表
export function getMengliList(data) {
  return request({
    url: '/admin/mengli/list',
    method: 'post',
    data
  });
}
export function getMengliListTotal(data) {
  return request({
    url: '/admin/mengli/total',
    method: 'post',
    data
  });
}

// 获取ip详情
export function getMengliIpDetail(params) {
  return request({
    url: '/admin/mengli/detail',
    method: 'get',
    params
  });
}

// 获取所有表情包IP
export function getOptionsIp() {
  return request({
    url: '/admin/mengli/option/ip',
    method: 'get'
  });
}

// 新建表情包
export function createMengli(data) {
  return request({
    url: '/admin/mengli/create',
    method: 'post',
    data
  });
}

// 编辑ip信息
export function editMengliIp(data) {
  return request({
    url: '/admin/mengli/ipEdit',
    method: 'post',
    data
  });
}

// 编辑表情包
export function editMengli(data) {
  return request({
    url: '/admin/mengli/edit',
    method: 'put',
    data
  });
}

// 获取详情
export function getBiaoqingDetail(params) {
  return request({
    url: '/admin/mengli/detail',
    method: 'get',
    params
  });
}

// 获取作品信息
export function getMengliWorkInfo(id) {
  return request({
    url: `/admin/mengli/work/${id}`,
    method: 'get'
  });
}

// 获取作品赞赏
export function getMengliWorkReward(params) {
  return request({
    url: '/admin/mengli/reward',
    method: 'get',
    params
  });
}
// 获取作品发送量/下载趋势
export function getMengliWorkSendNum(params) {
  return request({
    url: '/admin/mengli/work/sendNum',
    method: 'get',
    params
  });
}
// 获取单个表情发送量趋势
export function getMengliSendNum(params) {
  return request({
    url: '/admin/mengli/sendNum',
    method: 'get',
    params
  });
}

export function getRelatedList(params) {
  return request({
    url: '/admin/mengli/relevantList',
    method: 'get',
    params
  });
}

// 萌力星球详情页平均数据
export function getAverageData(id) {
  return request({
    url: `admin/mengli/detail/averageData/${id}`,
    method: 'get'
  });
}

// 萌力订单-全部订单
export function getmengliAllOrder(params, cancelToken) {
  return request({
    url: 'admin/mengli/allOrder/list',
    method: 'get',
    params,
    cancelToken
  });
}

// 萌力订单-ip授权
export function getmengliIpLicense(params) {
  return request({
    url: 'admin/mengli/ipLicense/list',
    method: 'get',
    params
  });
}

// 萌力订单-表情包
export function getmengliEmoji(params) {
  return request({
    url: 'admin/mengli/emoji/list',
    method: 'get',
    params
  });
}

// 萌力订单-渠道订单
export function getmengliOrder(params) {
  return request({
    url: 'admin/mengli/order/list',
    method: 'get',
    params
  });
}

// 获取萌力渠道订单-详情
export function mengliOrderInfo(id) {
  return request({
    url: `admin/mengli/order/detail/${id}`,
    method: 'get'
  });
}

// 获取萌力渠道订单-新增
export function getOrderAdd(data) {
  return request({
    url: 'admin/mengli/order/create',
    method: 'post',
    data
  });
}
// 获取萌力渠道订单-编辑
export function getOrderEdit(id, data) {
  return request({
    url: `admin/mengli/order/${id}/edit`,
    method: 'put',
    data
  });
}

// 萌力订单-电商
export function getmengliCommerce(params) {
  return request({
    url: 'admin/mengli/commerce/list',
    method: 'get',
    params
  });
}

// 萌力电商列表-新增
export function addCommerce(data) {
  return request({
    url: 'admin/mengli/commerce/create',
    method: 'post',
    data
  });
}

// 获取sku列表
export function getSkuList(params) {
  return request({
    url: '/admin/mengli/sku/list',
    method: 'get',
    params
  });
}

// 萌力电商列表-编辑
export function editCommerce(id, data) {
  return request({
    url: `admin/mengli/commerce/edit/${id}`,
    method: 'put',
    data
  });
}

// 萌力电商列表-获取详情
export function getCommerceInfo(id) {
  return request({
    url: `admin/mengli/commerce/detail/${id}`,
    method: 'get'
  });
}

// 萌力电商售后-创建
export function addAfterSale(data) {
  return request({
    url: 'admin/mengli/afterSales/create',
    method: 'post',
    data
  });
}

// 萌力电商售后-编辑
export function editAfterSale(id, data) {
  return request({
    url: `admin/mengli/afterSales/edit/${id}`,
    method: 'put',
    data
  });
}

// 萌力电商售后-详情
export function getAfterSaleDetail(id) {
  return request({
    url: `admin/mengli/afterSales/detail/${id}`,
    method: 'get'
  });
}

// 萌力电商售后-列表
export function getAfterSaleList(params) {
  return request({
    url: 'admin/mengli/afterSales/list',
    method: 'get',
    params
  });
}

// 萌力电商售后-退货处理
export function returnSale(data) {
  return request({
    url: 'admin/mengli/afterSales/returnsStatus',
    method: 'put',
    data
  });
}

// 萌力电商售后-批量退货处理
export function batchReturnSale(data) {
  return request({
    url: '/admin/mengli/afterSales/returnsStatus/batch',
    method: 'put',
    data
  });
}

// 萌力电商售后-待处理记录dialog
export function addInventoryLog(id, params) {
  return request({
    url: `/admin/mengli/inventory/stockIn/log/${id}`,
    method: 'post',
    params
  });
}

// 萌力电商售后-删除
export function deleteAfterSale(id) {
  return request({
    url: `admin/mengli/afterSales/delete/${id}`,
    method: 'delete'
  });
}

// 萌力订单-删除
export function mengliOrderDel(id) {
  return request({
    url: `admin/mengli/order/del/${id}`,
    method: 'delete'
  });
}

// 萌力IP管理-获取IP系列列表
export function getMengliIpSeries(params) {
  return request({
    url: 'admin/mengli/ipSeries/list',
    method: 'get',
    params
  });
}
// 萌力IP管理-创建IP系列
export function createMengliIpSeries(data) {
  return request({
    url: 'admin/mengli/ipSeries/create',
    method: 'post',
    data
  });
}
// 萌力IP管理-编辑IP系列
export function editMengliIpSeries(data) {
  return request({
    url: 'admin/mengli/ipSeries/edit',
    method: 'put',
    data
  });
}
// 萌力IP管理-删除IP系列
export function mengliIpSeriesDel(params) {
  return request({
    url: 'admin/mengli/ipSeries/delete',
    method: 'delete',
    params
  });
}
// 萌力IP管理-删除IP形象
export function mengliIpImageDel(params) {
  return request({
    url: 'admin/mengli/ipDelete',
    method: 'delete',
    params
  });
}
// 萌力IP管理-创建IP形象
export function createMengliIpImage(data) {
  return request({
    url: 'admin/mengli/ipImage/create',
    method: 'post',
    data
  });
}

// 萌力客户管理-客户列表
export function getMengliCustomerList(params) {
  return request({
    url: 'admin/mengli/client/list',
    method: 'get',
    params
  });
}
// 萌力客户管理-新增客户
export function createMengliCustomer(data) {
  return request({
    url: 'admin/mengli/client/create',
    method: 'post',
    data
  });
}

// 萌力客户管理-获取客户详情
export function getMengliCustomerInfo(id) {
  return request({
    url: `admin/mengli/client/info/${id}`,
    method: 'get'
  });
}

// 萌力客户管理-编辑客户
export function editMengliCustomer(data) {
  return request({
    url: 'admin/mengli/client/edit',
    method: 'put',
    data
  });
}

// 萌力客户管理-删除客户
export function mengliCustomerDel(params) {
  return request({
    url: 'admin/mengli/client/delete',
    method: 'delete',
    params
  });
}

// 萌力星球-供应商管理-列表
export function getSuppliers(page, perPage, params) {
  return request({
    url: 'admin/mengli/suppliers',
    method: 'get',
    params: {
      page,
      perPage,
      ...params
    }
  });
}
// 萌力星球-供应商管理-列表
export function getMengliSuppliers(params) {
  return request({
    url: 'admin/mengli/suppliers',
    method: 'get',
    params
  });
}
// 萌力星球-供应商管理-删除
export function deleteSupplier(id) {
  return request({
    url: `admin/mengli/supplier/${id}`,
    method: 'delete'
  });
}

// 萌力星球-供应商管理-编辑
export function editSupplier(id, data) {
  return request({
    url: `admin/mengli/supplier/${id}`,
    method: 'put',
    data
  });
}

// 萌力星球-供应商管理-新建
export function createSupplier(data) {
  return request({
    url: 'admin/mengli/supplier',
    method: 'post',
    data
  });
}

// 萌力星球-供应商管理-获取供应商信息
export function getSupplierInfo(id) {
  return request({
    url: `admin/mengli/supplier/${id}`,
    method: 'get'
  });
}

// 萌力IP管理-获取IP形象列表
export function getMengliIpImageList(params) {
  return request({
    url: 'admin/mengli/ipImage/list',
    method: 'get',
    params
  });
}

// 库存管理
// IP列表
export function getmengliIpList(params) {
  return request({
    url: 'admin/mengli/ipImage/list',
    method: 'get',
    params
  });
}

// 新建库存
export function createInventory(data) {
  return request({
    url: 'admin/mengli/inventory/create',
    method: 'post',
    data
  });
}

// 编辑库存
export function editInventory(id, data) {
  return request({
    url: `admin/mengli/inventory/edit/${id}`,
    method: 'post',
    data
  });
}

// 库存列表
export function getInventoryList(params, cancelToken) {
  return request({
    url: 'admin/mengli/inventory/list',
    method: 'get',
    params,
    cancelToken
  });
}

// 删除入库记录
export function deleteInventoryLog(params) {
  return request({
    url: 'admin/mengli/inventory/delete',
    method: 'post',
    params
  });
}

// 库存详情
export function getInventoryDetail(id) {
  return request({
    url: `admin/mengli/inventory/detail/${id}`,
    method: 'get'
  });
}

// 萌力-库存管理-安全值编辑
export function editInventorySecurity(data) {
  return request({
    url: 'admin/mengli/inventory/security/edit',
    method: 'put',
    data
  });
}

// 萌力-库存管理-残次品出库
export function editDefectiveStockOut(data) {
  return request({
    url: 'admin/mengli/inventory/defectiveStockOut/edit',
    method: 'post',
    data
  });
}

// 库存详情-入库记录
export function getInventoryDetailLog(id, params) {
  return request({
    url: `admin/mengli/inventory/detail/log/${id}`,
    method: 'get',
    params
  });
}

// 萌力-库存管理-数据对比
export function getComparisonData(params) {
  return request({
    url: '/admin/mengli/inventory/comparisonData/list',
    method: 'get',
    params
  });
}

// 库存详情-添加入库
export function addInventory(data) {
  return request({
    url: 'admin/mengli/inventory/add',
    method: 'post',
    data
  });
}

// 入库记录编辑
export function editInventoryLog(data) {
  return request({
    url: 'admin/mengli/inventory/edit',
    method: 'put',
    data
  });
}

// 电商订单统计
export function getCommerceOrderStatistics(params) {
  return request({
    url: 'admin/mengli/commerce/statistics',
    method: 'get',
    params
  });
}

// 库存列表-入库记录列表
export function getInventoryListLog(params) {
  return request({
    url: 'admin/mengli/inventory/list/inventoryLog',
    method: 'get',
    params
  });
}

// 萌力-库存管理-出入库明细
export function getStockDetail(params) {
  return request({
    url: 'admin/mengli/inventory/stockDetail',
    method: 'get',
    params
  });
}

// 萌力-库存管理-入库记录
export function getStockInLog(id) {
  return request({
    url: `/admin/mengli/inventory/stockIn/log/${id}`,
    method: 'get'
  });
}

// 萌力-库存管理-出库记录
export function getStockOutLog(params) {
  return request({
    url: '/admin/mengli/inventory/stockOut/log',
    method: 'get',
    params
  });
}

// 萌力-库存管理-残次品出库日志
export function getDefectiveStockOutLog(id) {
  return request({
    url: `/admin/mengli/inventory/defectiveStockOut/logs/${id}`,
    method: 'get'
  });
}

// 萌力-库存管理-残次品出库日志备注增改
export function storeDefectiveStockOutRemarks(data) {
  return request({
    url: '/admin/mengli/inventory/defectiveStockOut/remarks/store',
    method: 'put',
    data
  });
}

// 萌力-入库记录列表-入库类型列表
export function getStockInTypeList(params) {
  return request({
    url: '/admin/mengli/inventory/stockInType/list',
    method: 'get',
    params
  });
}

// 萌力-入库记录-带盘点处理
export function takeStock(data) {
  return request({
    url: 'admin/mengli/inventory/stock/take',
    method: 'post',
    data
  });
}

// 萌力-入库记录-详情备注编辑
export function editInventoryRemark(data) {
  return request({
    url: 'admin/mengli/inventory/remark/edit',
    method: 'put',
    data
  });
}

// 库存列表-入库记录列表-统计
export function getInventoryListLogCount(params) {
  return request({
    url: 'admin/mengli/inventory/list/inventoryLog/count',
    method: 'get',
    params
  });
}

// 库存列表-入库记录列表-删除入库记录
export function deleteInventoryListLog(params) {
  return request({
    url: 'admin/mengli/inventory/list/inventoryLog/delete',
    method: 'post',
    params
  });
}

// 萌力-库存-仓库列表
export function getInventoryRepo(params = '') {
  return request({
    url: '/admin/mengli/inventory/repository',
    method: 'get',
    params
  });
}

// 萌力-库存-仓库-添加
export function createInventoryRepo(data) {
  return request({
    url: 'admin/mengli/inventory/repository/create',
    method: 'post',
    data
  });
}

// 萌力-库存-仓库-删除
export function deleteInventoryRepo(data) {
  return request({
    url: 'admin/mengli/inventory/repository/delete',
    method: 'post',
    data
  });
}

// 萌力-库存-仓库-编辑
export function editInventoryRepo(data) {
  return request({
    url: 'admin/mengli/inventory/repository/edit',
    method: 'post',
    data
  });
}

// 萌力-库存-列表统计数据
export function getInventoryStatistics(params) {
  return request({
    url: '/admin/mengli/inventory/list/statistics',
    method: 'get',
    params
  });
}

// 供应商详情
export function mengliSupplierInfo(id, params) {
  return request({
    url: `admin/supplier/manage/info/${id}`,
    method: 'get',
    params
  });
}
// 萌力-全部订单-统计数据
export function getAllOrderStatistics(params) {
  return request({
    url: 'admin/mengli/allOrder/statistics',
    method: 'get',
    params
  });
}
// 萌力-商务订单-统计数据
export function getIpLicenseStatistics(params) {
  return request({
    url: 'admin/mengli/ipLicense/statistics',
    method: 'get',
    params
  });
}

// 萌力-SKU记录列表
export function getSkuLogList(params) {
  return request({
    url: '/admin/mengli/skuLog/list',
    method: 'get',
    params
  });
}

// 萌力-结算记录列表
export function getSettleAccountsLogList(params) {
  return request({
    url: '/admin/mengli/settleAccountsLog/list',
    method: 'get',
    params
  });
}

// 萌力-结算记录-生成
export function generateSettleAccounts() {
  return request({
    url: '/admin/mengli/settleAccountsLog/generate'
  });
}

// 萌力-结算记录详情
export function getSettleAccountsDetail(id, params) {
  return request({
    url: `/admin/mengli/settleAccountsLog/detail/${id}`,
    method: 'get',
    params
  });
}

// 萌力-结算记录详情-刷新
export function refreshSettleAccounts(id, params) {
  return request({
    url: `/admin/mengli/settleAccountsLog/detail/refresh/${id}`,
    method: 'get',
    params
  });
}

// 萌力-差异SKU编码数量
export function getSkuDiffNum() {
  return request({
    url: 'admin/mengli/skuLog/skuDiffNum',
    method: 'get'
  });
}

// 萌力-电商售后根据订单编号获取商品信息
export function getGoodsInfo(sn) {
  return request({
    url: `admin/mengli/commerce/goodsInfo/${sn}`,
    method: 'get'
  });
}
